package wzs.arithmetics;

public class Test_wzs7
{
	public static void main(String[] args)
	{
		String str = "a12中国3@b&4语*言3c";  
		
		String E1 = "[\u4e00-\u9fa5]";
		String E2 = "[a-zA-Z]";
		String E3 = "[0-9]";
		
		int chcnt = 0;
		int encnt = 0;
		int numcnt = 0;
		
		String tmp;
		for (int i = 0; i < str.length(); i++)
		{
			tmp = String.valueOf(str.charAt(i));
			if (tmp.matches(E1))
			{
				chcnt++;
			}
			if (tmp.matches(E2))
			{
				encnt++;
			}
			if (tmp.matches(E3))
			{
				numcnt++;
			}
		}
		System.out.println("chn-->"+chcnt);
		System.out.println("en-->"+encnt);
		System.out.println("num-->"+numcnt);
		System.out.println("other-->"+(str.length() - (chcnt + encnt + numcnt)));
	}
}
